home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1995 October
/
EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso
/
Aminet
/
comm
/
fido
/
SHELTER275.lha
/
rexx
/
CheckCache.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-01-10
|
2KB
|
61 lines
/**/
v='$VER: CheckCache Rexx Check Cache Phone Numbers for a Site Williamson 55.01'
options results
parse upper arg args
port=""
site=""
template="Port/A,Site/A"
if ~ReadArgs(args,template) then do
say " "Fault(RC,'CheckCache')
say ' Usage: Rx CheckCache 'template
say ' Where Port is 'GetClip(SHELTER)'<line>'
say ' and Site is a Cache.cfg <node> entry'
say ' Displays cache and nodelist phone number'
exit 0
end;else do
port=upper(port)
if ~Show('p',port) then do
say ' Cannot find port' port
exit 0
end
end
lookup=GetClip('LOOKUP')||" >NIL: "
nlentry="nl"||Pragma('ID')
check_number(site)
exit
check_number:
cmd=lookup site 'nodelist:' nlentry
address COMMAND cmd
nlnumber=GetVar(nlentry'.number',"G")
if nlnumber="" then do;say site 'is not in nodelist';exit;end
else nlnumber=compress(nlnumber,'-')
si=get_string('si.'site)
if si="" then do;say site 'is not in cache';exit;end
numbers=get_string('numbers.'si)
inl=0
do i=1 to numbers
number=get_string(si'.'i)
if nlnumber=number then do
say 'Cache:'number' Nodelist:'nlnumber
inl=1
end;else say 'Cache:'number
end
if ~inl then say 'Nodelisted number 'nlnumber' is not in Cache'
return 0
get_string:
Address value port
'String $('arg(1)')'
if RESULT="RESULT" then RESULT = ""
Return RESULT
ReadVar:
if ~open('v','ENV:'arg(1),'r') then return ""
x=readln('v')
call close('v')
return x